<div class="box">
	<div class="heading">
		<h1><img src="/assets/admin/book.png" alt="" /><%= t('Management Book') %></h1>
		<div class="buttons">
			<%= link_to t("Insert Book"), newbooks_manager_books_path, :class => "button" %>
		</div>
	</div>
	<div class="content">
		<table class="list">
			<thead>
				<tr>
					<td width="1" style="text-align: center;">
					<input type="checkbox" class="checkall">
					</td>
					<td class="left"><%= t('ID Book') %></td>
					<td class="left"><%= t('Tittle') %></td>
					<td class="left"><%= t('Author') %></td>
					<td class="left"><%= t('Remaining') %></td>
					<td class="left"><%= t('Viewed') %></td>
					<td class="left"><%= t('Borrowed') %></td>
					<td class="center"><%= t('Action') %></td>
				</tr>
			</thead>
			<tbody>
				<%= form_tag searchbooks_manager_books_path, :method => :get do %>
				<tr class="search">
					<td></td>
					<td><%= text_field_tag "search_idbook", nil, :placeholder => 'Enter book\'s id ...',:title =>"Enter book\'s id ..."%></td>
					<td><%= text_field_tag "search_title", nil, :placeholder => 'Enter book\'s title ...',:title =>'Enter book\'s title ...' %></td>
					<td><%= text_field_tag "search_author", nil, :placeholder => 'Enter book\'s author ...',:title =>'Enter book\'s author ...'%></td>
					<td></td>
					<td></td>
					<td></td>
					<td align="center" style="width:130px;">
						<div style="float:left">
							<%= submit_tag t("Search"), :id => "yt0" %>
						</div>
					<% end %>
					<%= form_tag delete_multiple_books_manager_books_path, :method => :delete do %>
					<%= submit_tag t("Delete"), :confirm => "Are you sure ?", :id => "yt0" %>
					</td>
				</tr>
				<% @books.each do |book| %>
				<tr>
					<td style="text-align: center;">
						<%= check_box_tag 'book_ids[]',book.id,false, :class => 'checkitem' %>
					</td>
					<td class="left"><%= book.code %></td>
					<td class="left"><%= book.title %></td>
					<td class="left"><%= book.author %></td>
					<td class="left"><%= book.current_quantity %></td>
					<td class="left"><%= book.numviewed %></td>
					<td class="left"><%= book.numborrowed %></td>
					<td class="center">
						<%= link_to t('View'), showbooks_manager_books_path(book) %> | 
						<%= link_to t('Edit'), editbooks_manager_books_path(book)%> | 
						<%= link_to t('Delete'), destroybooks_manager_books_path(book), method: :delete, :confirm => "Are you really want to delete \n #{book.title} ?"%>
					</td>
				</tr>
				<% end %>
			</tbody>
		</table>
	</div>
</div>
<% end %>